package demo.game.chess.client.ui;

import demo.game.chess.common.AbstractChessPiece;

public abstract class AbstractIconTheme {

	public void applyTheme(final ChessPieceUI ui) {
		ui.setUrl(getUrl(ui.getPiece()));

		ui.setStyleName("chessImageCommon");
		ui.addStyleName(getBaseStyleName());
		ui.addStyleName(getBaseStyleName() + "_"
				+ ui.getPiece().getType().name());

	}

	protected abstract String getBaseStyleName();

	protected abstract String getTitle();

	protected abstract String getUrl(final AbstractChessPiece piece);

}
